package com.iwhalecloud.citybrain.flow.platform.manager.domain.model.form;

import lombok.Data;

import java.util.Objects;

@Data
public class FormFieldDTO {

    /**
     * 部署编号
     */
    private String deployId;

    /**
     * 字段ID
     */
    private String fieldId;

    /**
     * 字段名称
     */
    private String fieldName;
    /**
     * 字段类型
     * 0:普通字段
     * 1:附件
     */
    private Integer fieldType;

    /**
     * 是否可见
     */
    private Integer visiable;
    /**
     * 是否可编辑
     */
    private Integer edit;
    /**
     * 是否必填
     */
    private Integer required;
    /**
     * 是否可下载
     */
    private Integer download;
    /**
     * 是否可增减
     */
    private Integer incOrDec;

    public FormFieldDTO(){

    }

    public FormFieldDTO(Integer fieldType){
        this.fieldType = fieldType;
        this.required = 1;

        if (Objects.equals(0,fieldType)){
            this.edit=1;
            this.visiable=1;
        }else{
            this.download=1;
            this.incOrDec=1;
        }
    }
}
